#pragma once

#include <exception>
#include <QString>

namespace kryptos { namespace util {

class Exception : public std::exception
{
  public:

    Exception()
    {
        m_error.append("Exception");
    }

    Exception(QString error)
    {
        m_error.clear();
        m_error.append("Exception::");
        m_error.append(error);
    }

    Exception(int errorType, QString error)
    {
        m_error.clear();
        m_error.append("Exception::");
        m_error.append(error);
        m_errorCode = errorType;
    }


    ~Exception() throw () {}

    const char* what() const throw()
    {
        return m_error.toStdString().c_str();
    }

    int  getErrorCode(){ return m_errorCode;}

    void setErrorCode(int val){ m_errorCode = val;}

private:
  QString m_error;
  int     m_errorCode;

};

}}
